import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element'
import base from './config/base'
// 导入全局样式表
import './assets/css/global.css'
import md5 from 'js-md5'
import axios from 'axios'
import './config/axios'
import dayjs from 'dayjs'
// 导入字体图标
import './assets/fonts/iconfont.css'

Vue.prototype.$dayjs = dayjs// 可以全局使用dayjs
Vue.prototype.$md5 = md5
Vue.prototype.$base = base
// axios请求拦截
Vue.prototype.$http = axios
Vue.config.productionTip = false

// 定义全局权限指令
// 权限指令 v-has="123"
Vue.directive('has', {
  bind: function (el, binding) {
    if (!Vue.prototype.$_has(binding.value)) {
      el.style.display = 'none'
    }
  }
})
// 权限检查方法
// @value  bool
Vue.prototype.$_has = function (bool) {
  return bool
}

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
